<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spring Boot 自定义 Starter 完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-shadow {
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        
        .hover-lift {
            transition: all 0.3s ease;
        }
        
        .hover-lift:hover {
            transform: translateY(-5px);
            box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15), 0 15px 15px -5px rgba(0, 0, 0, 0.06);
        }
        
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .section-divider {
            height: 2px;
            background: linear-gradient(to right, transparent, #e5e7eb, transparent);
            margin: 3rem 0;
        }
        
        .code-block {
            background: #1e293b;
            color: #e2e8f0;
            border-radius: 0.75rem;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 0.875rem;
            line-height: 1.7;
            position: relative;
        }
        
        .code-block::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #667eea, #764ba2);
        }
        
        .feature-card {
            background: white;
            border-radius: 1rem;
            padding: 2rem;
            transition: all 0.3s ease;
            border: 1px solid #e5e7eb;
        }
        
        .feature-card:hover {
            border-color: #667eea;
            transform: translateY(-3px);
        }
        
        .step-number {
            width: 3rem;
            height: 3rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.25rem;
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
            border-left: 4px solid #667eea;
            padding: 1.5rem;
            border-radius: 0.5rem;
            margin: 1.5rem 0;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        h2 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #1e293b;
            margin-top: 3rem;
            margin-bottom: 1.5rem;
            font-size: 2rem;
        }
        
        h3 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 500;
            color: #334155;
            margin-top: 2rem;
            margin-bottom: 1rem;
            font-size: 1.5rem;
        }
        
        h4 {
            font-family: 'Noto Sans SC', sans-serif;
            font-weight: 500;
            color: #475569;
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
            font-size: 1.25rem;
        }
        
        p {
            line-height: 1.8;
            color: #475569;
            margin-bottom: 1rem;
        }
        
        ul {
            list-style: none;
            padding-left: 0;
        }
        
        ul li {
            position: relative;
            padding-left: 2rem;
            margin-bottom: 0.75rem;
            color: #475569;
            line-height: 1.8;
        }
        
        ul li::before {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 0;
            color: #667eea;
        }
        
        .intro-card {
            background: white;
            border-radius: 1.5rem;
            padding: 3rem;
            margin-bottom: 3rem;
            position: relative;
            overflow: hidden;
        }
        
        .intro-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="text-center">
                <h1 class="text-5xl font-bold mb-6" style="font-family: 'Noto Serif SC', serif;">
                    Spring Boot 自定义 Starter
                </h1>
                <p class="text-xl opacity-90 max-w-3xl mx-auto">
                    掌握企业级应用开发的核心技术，打造可复用、高效能的模块化组件
                </p>
                <div class="mt-8 flex justify-center space-x-6">
                    <div class="flex items-center">
                        <i class="fas fa-cube text-2xl mr-2"></i>
                        <span>模块化设计</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-cogs text-2xl mr-2"></i>
                        <span>自动装配</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-rocket text-2xl mr-2"></i>
                        <span>开箱即用</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto px-6 py-12">
        <!-- Introduction Card -->
        <div class="intro-card card-shadow">
            <div class="relative z-10">
                <h2 class="text-3xl gradient-text mb-4">为什么需要自定义 Starter？</h2>
                <p class="text-lg leading-relaxed mb-4">
                    在开发企业级应用时，随着系统功能的扩展和模块化需求的增加，我们通常需要重用多个项目中的相同组件和功能。Spring Boot 的 Starter 机制为我们提供了一个极具灵活性的解决方案，它允许开发者将特定功能的配置、依赖和逻辑打包成一个独立的模块，方便在多个项目中直接使用。
                </p>
                <div class="grid md:grid-cols-2 gap-6 mt-8">
                    <div class="feature-card hover-lift">
                        <div class="flex items-start">
                            <div class="mr-4">
                                <i class="fas fa-layer-group text-3xl text-purple-600"></i>
                            </div>
                            <div>
                                <h4 class="font-semibold text-lg mb-2">模块化封装</h4>
                                <p class="text-gray-600">将常用的业务逻辑、配置和依赖封装成独立模块，实现代码复用</p>
                            </div>
                        </div>
                    </div>
                    <div class="feature-card hover-lift">
                        <div class="flex items-start">
                            <div class="mr-4">
                                <i class="fas fa-magic text-3xl text-purple-600"></i>
                            </div>
                            <div>
                                <h4 class="font-semibold text-lg mb-2">自动配置</h4>
                                <p class="text-gray-600">通过自动装配机制，减少手动配置工作，提高开发效率</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Concept Visualization -->
        <div class="bg-white rounded-xl p-8 card-shadow mb-12">
            <h2 class="text-center mb-8">Starter 架构概览</h2>
            <div class="mermaid">
                graph TB
                    A[Spring Boot 应用] --> B[引入 Starter 依赖]
                    B --> C[自动配置类]
                    C --> D[条件装配]
                    D --> E[注册 Bean]
                    E --> F[应用可用]
                    
                    G[spring.factories] --> C
                    H[配置属性] --> C
                    
                    style A fill:#667eea,stroke:#fff,color:#fff
                    style F fill:#764ba2,stroke:#fff,color:#fff
                    style G fill:#f3f4f6,stroke:#667eea
                    style H fill:#f3f4f6,stroke:#667eea
            </div>
        </div>

        <!-- Core Concepts -->
        <h2>核心概念与优势</h2>
        
        <div class="grid md:grid-cols-3 gap-6 mb-12">
            <div class="bg-white rounded-xl p-6 card-shadow hover-lift">
                <div class="text-center mb-4">
                    <i class="fas fa-box-open text-4xl text-purple-600"></i>
                </div>
                <h3 class="text-xl font-semibold text-center mb-3">开箱即用</h3>
                <p class="text-gray-600">
                    Starter 提供预配置的依赖和默认设置，开发者只需引入依赖即可使用完整功能，无需繁琐配置。
                </p>
            </div>
            
            <div class="bg-white rounded-xl p-6 card-shadow hover-lift">
                <div class="text-center mb-4">
                    <i class="fas fa-puzzle-piece text-4xl text-purple-600"></i>
                </div>
                <h3 class="text-xl font-semibold text-center mb-3">模块化设计</h3>
                <p class="text-gray-600">
                    将应用功能模块化，实现代码复用，确保多个项目中相同功能的一致性，降低维护成本。
                </p>
            </div>
            
            <div class="bg-white rounded-xl p-6 card-shadow hover-lift">
                <div class="text-center mb-4">
                    <i class="fas fa-sliders-h text-4xl text-purple-600"></i>
                </div>
                <h3 class="text-xl font-semibold text-center mb-3">灵活配置</h3>
                <p class="text-gray-600">
                    虽然提供默认配置，但允许通过配置文件灵活覆盖，满足不同项目的个性化需求。
                </p>
            </div>
        </div>

        <div class="section-divider"></div>

        <!-- Implementation Steps -->
        <h2>实现步骤详解</h2>
        
        <div class="space-y-8">
            <!-- Step 1 -->
            <div class="bg-white rounded-xl p-8 card-shadow">
                <div class="flex items-start">
                    <div class="step-number mr-6">1</div>
                    <div class="flex-1">
                        <h3 class="text-2xl mb-4">创建核心依赖模块</h3>
                        <p class="mb-4">
                            核心依赖模块是 Starter 的基础，包含业务逻辑、工具类和必要的依赖管理。通常命名为 <code class="bg-gray-100 px-2 py-1 rounded">starter-core</code>。
                        </p>
                        
                        <div class="highlight-box">
                            <h4><i class="fas fa-info-circle mr-2"></i>核心组成部分</h4>
                            <ul>
                                <li>业务逻辑实现类</li>
                                <li>工具类和辅助类</li>
                                <li>第三方依赖管理</li>
                                <li>默认配置定义</li>
                            </ul>
                        </div>
                        
                        <h4 class="mt-6 mb-3">Maven 依赖配置示例</h4>
                        <div class="code-block">
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&